<script setup>
import {
  House,
  Location, Message, Promotion, StarFilled, UploadFilled, User,
} from "@element-plus/icons-vue"
import router from "@/router";
import {ElMessage} from "element-plus";
const SignOut=()=>{
  router.push("/");
  ElMessage.success("退出登录")
}
</script>

<template>
  <el-container>
    <!-- 侧面菜单-->
    <el-aside width="400px" >
      <el-col :span="16">
        <h5 class="mb-2">资源管理系统</h5>
        <el-menu
            active-text-color="#ffd04b"
            background-color="#545c64"
            class="el-menu-vertical-demo"
            default-active="2"
            text-color="#fff"
            router
        >
          <el-menu-item index="/user">
            <el-icon><User /></el-icon>
            <span>个人资料</span>
          </el-menu-item>
          <el-menu-item index="/resources">
            <el-icon><House /></el-icon>
            <span>个人资源</span>
          </el-menu-item>
          <el-menu-item index="/publicresources">
            <el-icon><UploadFilled /></el-icon>
            <span>开放资源</span>
          </el-menu-item>
          <el-menu-item index="/attention">
            <el-icon><StarFilled /></el-icon>
            <span>关注列表</span>
          </el-menu-item>
          <el-menu-item index="/beadd">
            <el-icon><Promotion /></el-icon>
            <span>被访问列表</span>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-aside>
    <!--主界面-->
    <el-main class="main">
      <el-button type="primary" class="main-button" @click="SignOut()">退出登录</el-button>
      <router-view></router-view>
    </el-main>
  </el-container>
</template>

<style scoped>
.mb-2{
  font-family: "宋体",sans-serif;
  font-size: 20px;
  font-weight: bold;
}
.main{
  height: 740px;
}
.main-button{
  margin-bottom: -40px;
  margin-right: 100px;
  float: right;
}
</style>